CFLAGS = -g

all: ftpc

LIBS = 
DEFS = 

ifdef USE_RL
DEFS = -DUSE_RL
LIBS += -lreadline
endif

OBJS = ftpc_main.o ftpc_tcp.o ftpc_buf.o ftpc_util.o ftpc_ctl.o ftpc_dtp.o \
       ftpc_pi.o ftpc_stdin.o ftpc_select.o ftpc_event.o ftpc_log.o
%.o : %.c
	gcc -o $@ $(CFLAGS) -c $^ $(DEFS)

ftpc: $(OBJS)
	gcc -o ftpc $(CFLAGS) $(OBJS) $(LIBS) $(DEFS)

.PHONY: clean

clean:
	rm -rf $(OBJS) ftpc